import Vue from 'vue'
import Vuex from 'vuex'
import account from './modules/account'
import dict from './modules/dict'
const PagesStore = {
  state: {
    homePage: '', // 首页地址
    spinning: false,
    spinningcount: 0
  },
  mutations: {
    // 全局loading
    SET_SPINNING (state, spinning) {
      state.spinning = spinning
    },
    setSpinningcount (state, number) {
      state.spinningcount += number
    }
  },
  actions: {

  },
  modules: {
    account,
    dict
  },
  getters: {
    roles: state => state.account.roles,
    userInfo: state => state.account.userInfo,
    config: state => state.account.config
  }
}
Vue.use(Vuex)
export default new Vuex.Store(PagesStore)
